Skip to content

Fixes #34774: bot PUT keeps user-curated tags, owners and retentionPeriod - #34775

Merged
ulixius9 merged 3 commits into
mainfrom
ulixius9/override-tags-keep-other-classifications
Oct 7, 2026
Merged

ulixius9 merged 3 commits into
mainfrom
ulixius9/override-tags-keep-other-classifications

Conversation

@ulixius9

@ulixius9 ulixius9 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Fixes #34774

Since #32496, a bot bulk PUT with overrideMetadata=true that carries at least one tag replaces the entity's (or column's) whole tag list. Tags no source can emit — Tier.*, automator-applied/propagated tags, user-applied tags, glossary terms — are deleted on every override run. On customer instances this shows up as a daily cycle: the automator re-adds Tier, the next ingestion run removes it (3,264 removals across 468 tables on one instance; 41 columns on another), with two versions and two change events per asset per day, and user-applied tags lost permanently.

EntityRepository.updateTags now, on the override PUT path, keeps every stored tag whose classification (or glossary) does not appear in the request (keepTagsOutsideRequestedClassifications). Within a classification the request does carry, override still replaces — so the #28505 / #32496 case (a mutually exclusive tag changed upstream) works as before. Tables and columns share updateTags, so both are fixed.

Also in this PR — two more bot-PUT fields that lose user data (found by auditing every field a bot PUT touches, then reproduced on release-2-0):

  • Owners (with or without override). A bot PUT carrying owners replaced the owners a user assigned. Database connectors send ownerConfig owners (including its default) on every database/schema/table, and pipeline connectors send owners by default (includeOwners defaults to true) — while the includeOwners docs promise an existing owner "will not be overwritten". The guard in updateOwners only fired when the bot's policy denied EditOwners, and no shipped bot policy does (the ingestion bot's EditAll subsumes it), so it never fired. A bot PUT now only fills owners on an entity that has none; a PATCH (e.g. dbt dbtUpdateOwners) or a bulk run with overrideMetadata=true still reassigns them. This reverses the policy-keyed behaviour from perf: one-transaction flush + async indexing write path, read-path fixes #28675, so test_singleEntityPut_bot_updatesOwnersWhenPolicyAllows is flipped to test_singleEntityPut_bot_preservesUserOwners.
  • retentionPeriod. No connector sends it, so every bot PUT that changed the sourceHash — and every override run — blanked it on Table, DatabaseSchema, Database and Container. New EntityUpdater.updateUserOnlyField keeps the stored value when a bot PUT omits such a field. The PUT/bulk original carries the entity's own value, not the schema-inherited one, so inheritance is not frozen onto the table.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • Override re-sync that sends only a new tag from the source's classification replaces the old source tag and keeps a stored tag from another classification — on the table.
  • Same, on a column.
  • Existing: override replaces a mutually exclusive table/column tag; override with no tags keeps stored tags.
  • A user-assigned owner survives a bot re-sync that sends another owner (no override); override replaces it; a bot still fills owners on an entity that has none.
  • A user-set retentionPeriod survives a bot re-sync with and without override (table), and with override (schema).

Unit tests

  • Not applicable — behaviour is covered end-to-end by the integration tests below.

Backend integration tests

  • openmetadata-integration-tests/.../BulkOverrideMetadataIT.java: test_overrideKeepsTableTagsFromClassificationsNotSent, test_overrideKeepsColumnTagsFromClassificationsNotSent
  • BulkOverrideMetadataIT: test_botKeepsUserOwners_withoutOverride, test_botReplacesUserOwners_withOverride, test_botFillsOwners_whenEntityHasNone, test_botKeepsTableRetentionPeriod_withoutOverride, test_botKeepsTableRetentionPeriod_withOverride, test_botKeepsSchemaRetentionPeriod_withOverride
  • BaseEntityIT.test_singleEntityPut_bot_preservesUserOwners (flipped from ..._updatesOwnersWhenPolicyAllows)
  • Without the fixes, the tag tests fail (other classification's tag wiped), and 5 of the 7 owner/retention tests fail (owner replaced, retentionPeriod null); the override-replaces and fill-when-empty owner tests pass either way, as intended.
  • With the fixes: BulkOverrideMetadataIT 26/26; the four BaseEntityIT owner tests pass on Table, Pipeline, Dashboard, Topic, DatabaseSchema and Container.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Reproduced the bug on release-2-0.getcollate.io (2.0.202610060000) with a throwaway service:

  1. ingestion-bot bulk-PUT a table with PII.Sensitive on the table and column c1.
  2. Admin added Tier.Tier1 to the table and PersonalData.Personal to c1.
  3. ingestion-bot bulk-PUT again with a changed sourceHash:
    • overrideMetadata=true, sends PII.Sensitive → table/c1 left with only PII.Sensitive (Tier + column tag wiped)
    • overrideMetadata=true, sends no tags → all kept
    • overrideMetadata=false, sends PII.Sensitive → all kept

Owners and retentionPeriod on the same instance: admin set owner A / retentionPeriod=P30D, then ingestion-bot re-synced (owner B / no retention). Unchanged sourceHash without override: kept (skipped). Unchanged sourceHash with override, or a changed sourceHash without it: owner replaced by B and retentionPeriod blanked on table, schema and database.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

…it sends

A bot bulk PUT with overrideMetadata=true that carried any tag replaced the
whole tag list, deleting Tier, automator-propagated and user-applied tags no
source ever emits; the automator re-added them and the next run removed them
again. Override now replaces stored tags only within the classifications and
glossaries present in the request, at table and column level.
Copilot AI balanced review requested due to automatic review settings October 6, 2026 14:21
@ulixius9
ulixius9 requested a review from a team as a code owner October 6, 2026 14:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 6, 2026
Copilot AI balanced review requested due to automatic review settings October 6, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Oct 6, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🔴 High risk · Bot PUTs now change persisted owner, retention-period, and classification-tag handling.

Fixes tag replacement, owner overwriting, and retentionPeriod erasure during bot PUT operations. Tags from classifications not sent by the bot are now preserved; user-assigned owners survive bot re-syncs without override; and retentionPeriod retains user values when omitted from the request. Comprehensive integration tests verify the fix on tables, columns, and schemas.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-06T19:47:07Z)

Blocked the queue: integration-tests-mysql-elasticsearch

This branch was previously deployed

1 inactive deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bulk PUT with overrideMetadata wipes Tier, automator and user tags the source never sends

3 participants